<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的留言 | {$site_name}</title>
    <include file="user:include"/>
</head>
<body>

<div class="layui-layout layui-layout-admin">
    <include file="user:header"/>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <include file="user:userNav"/>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div id="content">
            <div class="layui-card layui-comment">
                <!-- // 默认操作按钮 -->
                <div class="layui-card-header layadmin-card-header-auto ">
                    <div class="layui-form">
                        <div class="layui-form-item">

                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <input name="keyword" class="layui-input" type="text" placeholder="{:__('关键字搜索')}"/>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <!-- // 默认搜索 -->
                                <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit><i
                                        class="layui-icon layui-icon-search"></i>{:__('搜索')}
                                </button>

                            </div>
                        </div>
                    </div>
                </div>

                <!-- // 创建数据实例 -->
                <table id="lay-tableList" lay-filter="lay-tableList"></table>
            </div>
        </div>

    </div>

    <include file="user:footer"/>
</div>
<!-- // 添加编辑数据 -->
<script type="text/html" id="editforms">
    <div class="layui-fluid layui-bg-white">
        <form action="{:url('/system.guestbook/reply')}" class="layui-form layui-form-fixed" lay-filter="editforms">
            <input type="text" name="id" hidden="">
            <div class="layui-form-item">
                <label class="layui-form-label"><font color="red">* </font>{:__('用户名')}</label>
                <div class="layui-input-block">
                    <input type="text" name="name" class="layui-input layui-disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">{:__('留言内容')}</label>
                <div class="layui-input-block">
                    <textarea name="content" class="layui-textarea"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">{:__('回复内容')}</label>
                <div class="layui-input-block">
                    <textarea name="reply" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-footer layui-form-item layui-center">
                <button class="layui-btn layui-btn-primary" type="button" sa-event="closePageDialog">{:__('取消')}
                </button>
                <button class="layui-btn" lay-filter="submitPage" lay-submit>{:__('提交')}</button>
            </div>
        </form>
    </div>
</script>

<!-- // 列表工具栏 -->
<script type="text/html" id="tableBar">
    <a class="layui-table-text" lay-open lay-title="{:__('编辑')}" lay-area="650px,395px"
       lay-url="/user/gbookedit?id={{d.id}}" lay-event="reply">{:__('编辑')}</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a class="layui-table-text" onclick="layer.msg('暂不支持删除','info')" lay-event="del">{:__('删除')}</a>
</script>

</body>
</html>
<script>
    layui.use(['table'], function () {

        var table = layui.table;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url('/user/gbook')}"
            , page: true
            , limit: 18
            , cols: [[
                {type: 'checkbox', width: 45},
                {field: 'id', align: 'center', sort: true, width: 80, title: 'ID'},
                {field: 'content', align: 'left', title: '{:__("留言内容")}'},
                {field: 'ip', align: 'center', width: 160, title: '{:__("登录IP")}'},
                {field: 'createtime', align: 'center', width: 160, title: '{:__("评论时间")}'},
                {align: 'center', toolbar: '#tableBar', width: 160, title: '{:__("操作")}'},
            ]]
        })
    })
</script>

</body>
</html>